/* 全局样式 */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    padding-top: 76px; /* 为固定导航栏留出空间 */
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: 600;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    transform: translateY(-2px);
}

/* 主要内容区域 */
.main-content {
    min-height: calc(100vh - 200px);
}

/* 英雄区域样式 */
.hero-section {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>') repeat;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
}

/* 按钮样式 */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

/* 表格样式 */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table th {
    border-top: none;
    font-weight: 600;
    background-color: var(--light-color);
}

/* 表单样式 */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 标签样式 */
.badge {
    font-size: 0.875em;
    border-radius: var(--border-radius);
}

/* 加载指示器 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* 消息提示样式 */
.alert {
    border-radius: var(--border-radius);
    border: none;
}

.alert .btn-close {
    opacity: 0.7;
}

/* 进度条样式 */
.progress {
    border-radius: var(--border-radius);
    height: 1rem;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* 智能问答界面样式 */
.chat-container {
    height: 600px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: #f8f9fa;
}

.chat-message {
    margin-bottom: 1rem;
}

.chat-message.user {
    text-align: right;
}

.chat-message .message-bubble {
    display: inline-block;
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    word-wrap: break-word;
}

.chat-message.user .message-bubble {
    background-color: var(--primary-color);
    color: white;
}

.chat-message.assistant .message-bubble {
    background-color: white;
    border: 1px solid #dee2e6;
}

.chat-input {
    border-top: 1px solid #dee2e6;
    padding: 1rem;
    background-color: white;
}

/* 学习路径样式 */
.path-step {
    position: relative;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 3px solid #dee2e6;
    transition: all 0.3s ease;
}

.path-step.completed {
    border-left-color: var(--success-color);
    background-color: rgba(40, 167, 69, 0.1);
}

.path-step.active {
    border-left-color: var(--primary-color);
    background-color: rgba(0, 123, 255, 0.1);
}

.path-step::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 1.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #dee2e6;
}

.path-step.completed::before {
    background-color: var(--success-color);
}

.path-step.active::before {
    background-color: var(--primary-color);
}

/* 数据可视化样式 */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* 知识点卡片 */
.knowledge-card {
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.knowledge-card:hover {
    border-left-color: var(--success-color);
    background-color: rgba(0, 123, 255, 0.05);
}

/* 掌握度指示器 */
.mastery-indicator {
    width: 100px;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.mastery-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc3545 0%, #ffc107 50%, #28a745 100%);
    transition: width 0.3s ease;
}

/* 学习统计卡片 */
.stat-card {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: scale(1.05);
}

.stat-card i {
    font-size: 3rem;
    opacity: 0.7;
    margin-bottom: 1rem;
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* 课程卡片 */
.course-card {
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.3s ease;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.15);
}

.course-card .course-image {
    height: 200px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }
    
    .hero-section {
        text-align: center;
    }
    
    .hero-section .display-4 {
        font-size: 2rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .chat-container {
        height: 500px;
    }
    
    .chart-container {
        height: 300px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.slide-in {
    animation: slideIn 0.6s ease forwards;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* 工具提示样式 */
.tooltip {
    font-size: 0.875rem;
}

.tooltip-inner {
    background-color: var(--dark-color);
    border-radius: var(--border-radius);
}

/* 模态框样式 */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
}